package org.eclipse.emf.index.omds.core.query;

import java.util.ArrayList;

import javax.swing.text.TableView;

import org.eclipse.emf.index.EObjectDescriptor;
import org.eclipse.emf.index.IndexStore;
import org.eclipse.emf.index.EObjectDescriptor.Query;
import org.eclipse.emf.index.ui.internal.EmfIndexUIPlugin;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.FilteredItemsSelectionDialog;


public class QueryIndex {
	
	public ArrayList getIndex(){
		IndexStore indexStore = EmfIndexUIPlugin.getDefault().getIndexStore();
		Query query = indexStore.eObjectDAO().createQuery();
        // Query the index and load the indexed items.
        Iterable<EObjectDescriptor> list = query.executeListResult();
        ArrayList resourceList = new ArrayList();
        for (EObjectDescriptor item : list) {
                resourceList.add(item);
        }
        return resourceList;
		
	}

}

